<!--
 * @Author: HeAo
 * @Date: 2021-10-08 15:06:55
 * @LastEditTime: 2021-10-08 17:16:05
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2103code\3-2-Vue\day01\6-动态class-style.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>再见Vue</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
  <style>
    .box1 {
      width: 300px;
      height: 200px;
      border: 1px solid #333;
      font-size: 18px;
    }

    .box2 {
      border-radius: 5px;
      box-shadow: 0 0 5px rgb(4, 230, 230);
      font-size: 20px;
    }
  </style>
</head>

<body>
  <div id="app">
    <div class="box1 box2">盒子一</div><br>
    <div :class="{box1: isActive}">盒子二</div><br>
    <div :class="[class1, class2]">盒子三</div><br>
    <div :style="style1">盒子四</div><br>
    <div :style="[style1, style2]">盒子五</div>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        isActive: true,
        class1: 'box1',
        class2: 'box2',
        style1: {
          width: '200px',
          height: '300px',
          fontSize: '24px',
          border: '1px solid #333',
          // 'font-size': '24px'
        },
        style2: {
          width: '50px',
          height: '50px'
        }
      },
      methods: {

      }
    })
  </script>
</body>

</html>